// FrogRenameAutoNumAppendDialog.h : Declaration of the CFrogRenameAutoNumAppendDialog

#pragma once

#include "resource.h"       // main symbols
#include <atlhost.h>
#include <FrogOrderFilesDialog.h>


// CFrogRenameAutoNumAppendDialog

class CFrogRenameAutoNumAppendDialog: public CFrogOrderFilesDialog<CFrogRenameAutoNumAppendDialog>,
	public CWinDataExchange<CFrogRenameAutoNumAppendDialog>
{
public:
	CFrogRenameAutoNumAppendDialog(HICON hIcon);

	enum { IDD = IDD_DIALOG_RENAME_NUMBER_APPEND };

	BEGIN_MSG_MAP(CFrogRenameAutoNumAppendDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK)
		COMMAND_HANDLER(IDC_EDIT_SPOSTFIX, EN_CHANGE, OnEnChangeEditPostfix)
		COMMAND_HANDLER(IDC_EDIT_PREFIX, EN_CHANGE, OnEnChangeEditPrefix)
		COMMAND_HANDLER(IDC_EDIT_START_NUM, EN_CHANGE, OnEnChangeEditStartNum)
		// FrogOrderFilesDialog Inherited
		CHAIN_MSG_MAP(CFrogOrderFilesDialog)
	END_MSG_MAP()

	BEGIN_DDX_MAP(CFrogRenameAutoAlphaAppendDialog)
		DDX_TEXT(IDC_EDIT_SPOSTFIX, m_Postfix)
		DDX_TEXT(IDC_EDIT_PREFIX, m_Prefix)
		DDX_TEXT(IDC_EDIT_START_NUM, m_StartNumStr)	
	END_DDX_MAP()

	// Handler prototypes:
	//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPostfix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPrefix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditStartNum(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	virtual void ExecuteCommand();

	CString m_Postfix;
	CString m_Prefix;
	int m_StartNum;
private:

	CString m_StartNumStr;

	void SetPostPrePreviewAutoNumAlpha(wstring runningChar, wstring originalName = L"filename.ext");

};


